package com.itheima.iojob5;

import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        try

     (   FileWriter fr = new FileWriter("E:/test/student.txt");)
            {
                List<Student> stuList = new ArrayList<>();
                stuList.add(new Student("张三","男","20","88"));
            stuList.add(new Student("李四","女","19","99"));
            for (Student student : stuList) {
                fr.write( student.getName()+","+student.getGender()+","+student.getAge()+","+student.getScore()+"\r\n");

            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
